<template>
  <div>
    payBefore
    <form id="form" ref="form" action="https://unipay.ydfuture.com/api/v1/trade/cashDesk" method="post" style="display:none">
      <input ref="pay_params" type="text" name="pay_params" value="">
      <button type="submit">提交</button>
    </form>
  </div>
</template>
<script>
export default {
  data() {
    return {};
  },
  watch: {
    '$route': {
      handler: function (val, old) {
        console.log(val, old);
      }
    }
  },
  created() {

  },
  mounted() {
    this.$nextTick(() => {
      console.log(this.$route.query);
      this.$refs.pay_params.value = this.$route.query.value;
      this.$refs.form.submit();
    });
  }
};
</script>
